package com.jindy.module.approvalConfig.service.impl;

import java.util.List;
import com.jindy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jindy.module.approvalConfig.mapper.ApprovalConfigMapper;
import com.jindy.module.approvalConfig.domain.ApprovalConfig;
import com.jindy.module.approvalConfig.service.IApprovalConfigService;

/**
 * 审批单配置Service业务层处理
 * 
 * @author jindy
 * @date 2023-03-28
 */
@Service
public class ApprovalConfigServiceImpl implements IApprovalConfigService 
{
    @Autowired
    private ApprovalConfigMapper approvalConfigMapper;

    /**
     * 查询审批单配置
     * 
     * @param id 审批单配置主键
     * @return 审批单配置
     */
    @Override
    public ApprovalConfig selectApprovalConfigById(Long id)
    {
        return approvalConfigMapper.selectApprovalConfigById(id);
    }

    /**
     * 查询审批单配置列表
     * 
     * @param approvalConfig 审批单配置
     * @return 审批单配置
     */
    @Override
    public List<ApprovalConfig> selectApprovalConfigList(ApprovalConfig approvalConfig)
    {
        return approvalConfigMapper.selectApprovalConfigList(approvalConfig);
    }

    /**
     * 新增审批单配置
     * 
     * @param approvalConfig 审批单配置
     * @return 结果
     */
    @Override
    public int insertApprovalConfig(ApprovalConfig approvalConfig)
    {
        approvalConfig.setCreateTime(DateUtils.getNowDate());
        return approvalConfigMapper.insertApprovalConfig(approvalConfig);
    }

    /**
     * 修改审批单配置
     * 
     * @param approvalConfig 审批单配置
     * @return 结果
     */
    @Override
    public int updateApprovalConfig(ApprovalConfig approvalConfig)
    {
        approvalConfig.setUpdateTime(DateUtils.getNowDate());
        return approvalConfigMapper.updateApprovalConfig(approvalConfig);
    }

    /**
     * 批量删除审批单配置
     * 
     * @param ids 需要删除的审批单配置主键
     * @return 结果
     */
    @Override
    public int deleteApprovalConfigByIds(Long[] ids)
    {
        return approvalConfigMapper.deleteApprovalConfigByIds(ids);
    }

    /**
     * 删除审批单配置信息
     * 
     * @param id 审批单配置主键
     * @return 结果
     */
    @Override
    public int deleteApprovalConfigById(Long id)
    {
        return approvalConfigMapper.deleteApprovalConfigById(id);
    }
}
